#define _CRT_SECURE_NO_WARNINGS
#include"stdio.h"
int main() {
	int n = 0;
	int a = 1, b = 1,c=a+b;
	int i = 0;
	scanf("%d", &n);
	if (n == 1 || n == 2) {
		c = 1;
	}
	else {
		/*while (i <= n - 3) {
			i++;
			c = a + b;
			a = b;
			b = c;
		}*/
		while (n>=3) {
			c = a + b;
			a = b;
			b = c;
			n--;
		}
		printf("%d\n", c);
	}
	return 0;
}